#! /usr/bin/env python3.6
# 切片

arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

print('arr is: ', arr)
# slice [2,3]
print('slice 2 to 3: ', arr[2:3])

# slice [0:3]
print('slice 0 to 3: ',arr[:3])

#slice [3:END]
print('slice 3 to END: ', arr[3:])

#slice reverse [0:3]
print('slice reverse 0 to 3: ', arr[-3:])

#slice tuple
t = ('a','b','c','d','e')
print('tuple is: ', t)
print('slice tuple 1 to 3', t[1:3])

#slice str
string = 'Hello, world!'
print('string is: ', string)
print('slice string 1 to 3: ', string[1:3])